const shiftPage = (url) => {
    const path = window.location.pathname;
    const host = window.location.origin;
    const pss = path.split('/');
    pss.splice(pss.length - 1, 1);
    const npth = pss.join('/');
    const uss = url.split('');
    uss.splice(0, 1);
    const nurl = uss.join('');
    window.open(host + npth + nurl);
};

document.getElementById('section1').onclick = () => {
    shiftPage('./xiaoxing01-doc/index.html');
};
document.getElementById('section2').onclick = () => {
    shiftPage('./xiaoxing01/dist/index.html');
}

document.getElementById('section3').onclick = () => {
    shiftPage('./xiaoxing02-doc/index.html');
}
document.getElementById('section4').onclick = () => {
    shiftPage('./xiaoxing02/dist/index.html');
}
document.getElementById('section5').onclick = () => {
    shiftPage('./xiaoxing03-doc/index.html');
}
document.getElementById('section6').onclick = () => {
    shiftPage('./xiaoxing03/dist/index.html');
}